package com.ruoyi.car.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.car.mapper.CarInsuranceMapper;
import com.ruoyi.car.domain.CarInsurance;
import com.ruoyi.car.service.ICarInsuranceService;

/**
 * 保险配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class CarInsuranceServiceImpl implements ICarInsuranceService 
{
    @Autowired
    private CarInsuranceMapper carInsuranceMapper;

    /**
     * 查询保险配置
     * 
     * @param id 保险配置主键
     * @return 保险配置
     */
    @Override
    public CarInsurance selectCarInsuranceById(Long id)
    {
        return carInsuranceMapper.selectCarInsuranceById(id);
    }

    /**
     * 查询保险配置列表
     * 
     * @param carInsurance 保险配置
     * @return 保险配置
     */
    @Override
    public List<CarInsurance> selectCarInsuranceList(CarInsurance carInsurance)
    {
        return carInsuranceMapper.selectCarInsuranceList(carInsurance);
    }

    /**
     * 新增保险配置
     * 
     * @param carInsurance 保险配置
     * @return 结果
     */
    @Override
    public int insertCarInsurance(CarInsurance carInsurance)
    {
        carInsurance.setCreateTime(DateUtils.getNowDate());
        return carInsuranceMapper.insertCarInsurance(carInsurance);
    }

    /**
     * 修改保险配置
     * 
     * @param carInsurance 保险配置
     * @return 结果
     */
    @Override
    public int updateCarInsurance(CarInsurance carInsurance)
    {
        carInsurance.setUpdateTime(DateUtils.getNowDate());
        return carInsuranceMapper.updateCarInsurance(carInsurance);
    }

    /**
     * 批量删除保险配置
     * 
     * @param ids 需要删除的保险配置主键
     * @return 结果
     */
    @Override
    public int deleteCarInsuranceByIds(Long[] ids)
    {
        return carInsuranceMapper.deleteCarInsuranceByIds(ids);
    }

    /**
     * 删除保险配置信息
     * 
     * @param id 保险配置主键
     * @return 结果
     */
    @Override
    public int deleteCarInsuranceById(Long id)
    {
        return carInsuranceMapper.deleteCarInsuranceById(id);
    }
}
